package com.csdj.controller;

import com.csdj.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {
    @RequestMapping(value = "/user")
    public ModelAndView login(){
        ModelAndView modelAndView = new ModelAndView();
        List<User> users = new ArrayList<>();
        users.add(new User("张三","18",'男'));
        users.add(new User("李四","20",'男'));
        users.add(new User("丽丽","19",'女'));
        users.add(new User("王五","23",'男'));
        modelAndView.addObject("users",users);
        modelAndView.setViewName("demo_01");
        return modelAndView;
    }
}
